<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //promise承诺,只能干一件事,只能发布一次
        new Promise((resolve,reject)=>{
            setTimeout(() => {
                //resolve 解决
                //reject 拒绝
                //两者只能调用一次

                // resolve('hello')
                reject('哈哈哈,我不干了')

            }, 1000);
        })
        //then 然后
        // .then((res)=>{
        //     console.log(res);
        // })
        .catch((err)=>{
            console.log(err);
        })
    </script>
</body>
</html>